package com.adcc.swingui.demo.toolbar;

import java.awt.Container;
import java.util.List;

import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;

import com.adcc.swingui.base.DefaultToolBar;
import com.jidesoft.swing.JideSplitButton;

/**
 * 卫星影像
 * 
 * @author charlie
 * 
 */
public class SatelliteImageToolBut extends DefaultToolBar {

	private JideSplitButton but;

	private ButtonGroup satelliteImageGroup;

	private JRadioButtonMenuItem zbaa;
	private JRadioButtonMenuItem zbhh;
	private JRadioButtonMenuItem zbtj;
	private JRadioButtonMenuItem zggg;
	private JRadioButtonMenuItem zhhh;
	private JRadioButtonMenuItem zshc;
	private JRadioButtonMenuItem zspd;
	private JRadioButtonMenuItem zsss;
	private JRadioButtonMenuItem zuck;
	private JRadioButtonMenuItem zuuu;
	private JRadioButtonMenuItem item;

	public SatelliteImageToolBut(Container container) {
		super(container);
	}

	@Override
	protected JComponent build() {
		but = createSplitButton(new ImageIcon("res/images/saimg.png"));
		but.setToolTipText("卫星影像");
		satelliteImageGroup = new ButtonGroup();

		zbaa = createRadioButtonMenuItem("ZBAA", "ZBAA 北京/首都",
				satelliteImageGroup);
		addChildItem(but, zbaa, null);
		zbhh = createRadioButtonMenuItem("ZBHH", "ZBHH 呼和浩特/白塔",
				satelliteImageGroup);
		addChildItem(but, zbhh, null);
		zbtj = createRadioButtonMenuItem("ZBTJ", "ZBTJ 天津/滨海",
				satelliteImageGroup);
		addChildItem(but, zbtj, null);
		zggg = createRadioButtonMenuItem("ZGGG", "ZGGG 广州/白云",
				satelliteImageGroup);
		addChildItem(but, zggg, null);
		zhhh = createRadioButtonMenuItem("ZHHH", "ZHHH 武汉/天河",
				satelliteImageGroup);
		addChildItem(but, zhhh, null);
		zshc = createRadioButtonMenuItem("ZSHC", "ZSHC 杭州/萧山",
				satelliteImageGroup);
		addChildItem(but, zshc, null);
		zspd = createRadioButtonMenuItem("ZSPD", "ZSPD 上海/浦东",
				satelliteImageGroup);
		addChildItem(but, zspd, null);
		zsss = createRadioButtonMenuItem("ZSSS", "ZSSS 上海/虹桥",
				satelliteImageGroup);
		addChildItem(but, zsss, null);
		zuck = createRadioButtonMenuItem("ZUCK", "ZUCK 重庆/江北",
				satelliteImageGroup);
		addChildItem(but, zuck, null);
		zuuu = createRadioButtonMenuItem("ZUUU", "ZUUU 成都/双流",
				satelliteImageGroup);
		return but;
	}

	@Override
	protected void addMouseListener() {
		// 这里填写对应响应事件
		but = (JideSplitButton) sourceComp;
		// 状态设置（业务填写）
		if (but.isSelected()) {
			but.setSelected(false);
		} else {
			but.setSelected(true);
		}
		//获取选中子菜单
		List<String> list = getSelectedItemName((JMenuItem[])but.getMenuComponents());
	}

	@Override
	protected void i18n() {
		// TODO Auto-generated method stub

	}
}
